<?php
$this->breadcrumbs=array(
	'Orders'=>array('index'),
	Yii::t('ShopModule.shop', 'Manage'),
);

?>
<?php 

//$model = new Order();

$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'order-grid',
	'dataProvider'=>$model->searchByCustomer(),
	'filter'=>$model,
	'columns'=>array(
		'order_id',
        array(
            'name'  => 'distributor_id',
            'value' => 'Users::model()->findByPk($data->distributor_id)->full_name'
        ),
        array(
            'name' => 'buying_price',
            'value' => '$data->buying_price + $data->buy_tax'
        ),
        array(
            'name'  => 'shipping_price',
            'value' => '$data->status == 1 ? "Chờ đại lý xử lý" : $data->shipping_price + $data->shipping_tax'
        ),
		array('name' => 'created_time',
			'value' => 'date("d/m/Y", $data->created_time)'),
        array(
            'name' => 'status',
            'value' => '$data->getStatusName()'
            ),
		array(
			'class'=>'CButtonColumn', 
			'template' => '{view}',
		),

	),
)); ?>
